﻿// <copyright file="MockKingsCache.cs" company="Ecole Normale Supérieure">
// Released under GPLv2
// </copyright>
// <summary>Contains the0Mock KingsCache.</summary>

namespace Sqwarea.GameLogic.View
{
    using Sqwarea.Persistence;

    /// <summary>
    /// Mock for King Cache
    /// Just return a king with the given Id.
    /// </summary>
    public class MockKingsCache : IKingsCache
    {
        /// <summary>
        /// Get a king using cache -> just return a king with the given id.
        /// </summary>
        /// <param name="id">The id of the king</param>
        /// <returns>The king (UpdateAcademyTroops and UpdateNeutralId are NOT called on the king)</returns>
        public King GetKingById(long id)
        {
            if (id == King.NeutralKingId)
            {
                return new King(King.NeutralKingId, null, null);
            }
            else
            {
                return new King(id, "user", null);
            }
        }
    }
}
